//
//  PCFinancialManager.m
//  PromotionCode
//
//  Created by uuu9 on 2017/11/23.
//  Copyright © 2017年 My. All rights reserved.
//

#import "PCFinancialManager.h"
#import "PCAccountFinancialModel.h"
#import "PCAmountDetailModel.h"


@implementation PCFinancialManager

+(void)getAccountFinancialInfoWithUserID:(NSString *)uid andType:(NSString *)type andSessionID:(NSString *)sessionid andCompletionHandle:(void (^)(FinancialModel *, NSError *))complete{
    [self EncryptPOST:[NSString stringWithFormat:@"%@%@",Api_URL,kAccountInfo]
    parameters:[NSString stringWithFormat:@"userid=%@&type=%@&sessionid=%@",uid,type,sessionid]
completionHandler:^(id responseObj, NSError *error) {
    PCAccountFinancialModel *model = [PCAccountFinancialModel mj_objectWithKeyValues:responseObj];
    if (model.error_code != 0) {
        error = [self createError:model.error_msg];
    }
    complete(model.output,error);
}];
    
}


+(void)getAmountDetailListWithUserID:(NSString *)uid andSessionID:(NSString *)sessionid andCompletionHandle:(void (^)(PCAmountDetailModel *, NSError *))complete{
    [self EncryptPOST:[NSString stringWithFormat:@"%@%@",Api_URL,kAmountInOrOut]
           parameters:[NSString stringWithFormat:@"userid=%@&sessionid=%@",uid,sessionid]
    completionHandler:^(id responseObj, NSError *error) {
        PCAmountDetailModel *model = [PCAmountDetailModel mj_objectWithKeyValues:responseObj];
        if (model.error_code != 0) {
            error = [self createError:model.error_msg];
        }
        complete(model,error);
    }];
    
}


@end
